package com.lixinlei.springboot_servlet.filter.filterRegistrationbean;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FilterRegistrationBeanConfig {

    @Bean
    public FilterRegistrationBean<RegisterFilter> registerFilter(){
        FilterRegistrationBean<RegisterFilter> bean = new FilterRegistrationBean<RegisterFilter>();
        bean.setFilter(new RegisterFilter());
        bean.setName("registerFilter");
        bean.addUrlPatterns("/registrationBeanServlet");
        bean.setOrder(1);
        return bean;
    }

}
